<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateQaecmsOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('qaecms_orders', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('order_id')->comment('订单ID');
            $table->string('platform')->comment('支付平台')->default('ali');
            $table->string('platform_id')->comment('平台订单ID')->nullable();
            $table->string('user_id')->comment('用户ID');
            $table->string('shop_id')->comment('商品ID');
            $table->decimal('money',10,2)->comment('支付金额');
            $table->string('currency_type')->comment('货币类型');
            $table->tinyInteger('status')->comment('0 未支付 1支付成功 2支付失败');
            $table->dateTime('success_at')->comment('成功时间')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('qaecms_orders');
    }
}
